package com.tencreat.mapper.mall;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tencreat.domain.mall.MallCoupon;
import com.tencreat.domain.mall.MallCouponUser;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 优惠券用户使用Mapper接口
 *
 * @author tencreat
 * @date 2021-08-13
 */
public interface MallCouponUserMapper extends BaseMapper<MallCouponUser> {

    List<MallCoupon> getCouponByUuid(@Param("uuid") Long uuid ,@Param("date") LocalDateTime date);

    void grantCoupon(@Param("mallCoupon") MallCoupon mallCoupon);

    void grantNewUserCoupon(@Param("uuid") Long uuid ,@Param("time") LocalDateTime time);

    void updateState(@Param("id") Long id, @Param("uuid")Long uuid, @Param("status")Long status);

    List<MallCouponUser> getUserAllCoupon(@Param("uuid") Long uuid, @Param("status") Long status);

    List<MallCoupon> getCouponByUuidV2(@Param("uuid") Long uuid ,@Param("date") LocalDateTime date,@Param("usedStatus") Integer usedStatus);
}
